package com.yc.starter.login.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author navy
 * @company 源辰信息
 * @date 2024/9/12
 * @email haijunzhou@hnit.edu.cn
 */
@Component
@Data
@ConfigurationProperties("login")
public class LoginProperties {
    boolean enable;
    String userTable;
    String nameColumn;
    String pwdColumn;
    String emailColumn;
    String userClassName;
    String sessionKey;

    Class userClass;

    // IOC bean 生命周期方法
    // <bean init-method destroy-method>

    @PostConstruct // init-method
    void init() throws ClassNotFoundException {
        userClass = Class.forName(userClassName);
    }

}
